{% extends "package/base.html" %}

{% set logged_in = true if c.userobj else false %}
{% set res = resource %}

{% block breadcrumb_content_selected %}{% endblock %}

{% block breadcrumb_content %}
  {{ super() }}
  {% if res %}
      <li>{% link_for h.resource_display_name(res)|truncate(30), named_route=pkg.type ~ '_resource.read', id=pkg.name, resource_id=res.id %}</li>
      <li{% block breadcrumb_edit_selected %} class="active"{% endblock %}><a href="">{{ _('Edit') }}</a></li>
  {% endif %}
{% endblock %}

{% block content_action %}
    {% link_for _('All resources'), named_route=pkg.type ~ '.resources', id=pkg.name, class_='btn btn-default', icon='arrow-left' %}
    {% if res %}
	{% link_for _('View resource'), named_route=pkg.type ~ '_resource.read', id=pkg.name, resource_id=res.id, class_='btn btn-default', icon='eye' %}
  {% endif %}
{% endblock %}

{% block content_primary_nav %}
  {{ h.build_nav_icon(pkg.type ~ '_resource.edit', _('Edit resource'), id=pkg.name, resource_id=res.id, icon='pencil-square-o') }}
  {% block inner_primary_nav %}{% endblock %}
  {{ h.build_nav_icon(pkg.type ~ '_resource.views', _('Views'), id=pkg.name, resource_id=res.id, icon='bars') }}
{% endblock %}

{% block primary_content_inner %}
  <h1 class="hide-heading">{% block form_title %}{{ _('Edit resource') }}{% endblock %}</h1>
  {% block form %}{% endblock %}
{% endblock %}

{% block secondary_content %}
  {% snippet 'package/snippets/resource_info.html', res=res %}
{% endblock %}

{% block scripts %}
  {{ super() }}
  {% asset 'vendor/fileupload' %}
{% endblock %}
